#pragma once

#include <iostream>
#include "socket.hpp"
#include <signal.h>

class TcpServer
{
public:

    TcpServer(uint16_t port)
        :port_(port)
    {}
    ~TcpServer()
    {}

    bool Init()
    {
        listensock_.Socket();
        listensock_.Bind(port_);
        listensock_.Listen();
    }

    void Start() 
    {
        while(true)
        {
            uint16_t port;
            std::string ip;
            listensock_.Accept(&ip,&port);
        }

    }



private:
uint16_t port_;
Sock listensock_;

};